package com.jspgou.cms.entity.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the jc_consumer_top table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="jc_consumer_top"
 */

public abstract class BaseConsumerTop  implements Serializable {

	public static String REF = "ConsumerTop";
	public static String PROP_EMAIL = "email";
	public static String PROP_USERNAME = "username";
	public static String PROP_ORDER = "order";
	public static String PROP_ID = "id";
	public static String PROP_USER_ID = "userId";
	public static String PROP_TOTAL = "total";


	// constructors
	public BaseConsumerTop () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseConsumerTop (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseConsumerTop (
		java.lang.Integer id,
		double total) {

		this.setId(id);
		this.setTotal(total);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String username;
	private java.lang.String email;
	private double total;
	private java.lang.Long userId;

	// many to one
	private com.jspgou.cms.entity.Order order;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="identity"
     *  column="Id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: username
	 */
	public java.lang.String getUsername () {
		return username;
	}

	/**
	 * Set the value related to the column: username
	 * @param username the username value
	 */
	public void setUsername (java.lang.String username) {
		this.username = username;
	}


	/**
	 * Return the value associated with the column: email
	 */
	public java.lang.String getEmail () {
		return email;
	}

	/**
	 * Set the value related to the column: email
	 * @param email the email value
	 */
	public void setEmail (java.lang.String email) {
		this.email = email;
	}


	/**
	 * Return the value associated with the column: total
	 */
	public double getTotal () {
		return total;
	}

	/**
	 * Set the value related to the column: total
	 * @param total the total value
	 */
	public void setTotal (double total) {
		this.total = total;
	}


	/**
	 * Return the value associated with the column: user_id
	 */
	public java.lang.Long getUserId () {
		return userId;
	}

	/**
	 * Set the value related to the column: user_id
	 * @param userId the user_id value
	 */
	public void setUserId (java.lang.Long userId) {
		this.userId = userId;
	}


	/**
	 * Return the value associated with the column: total_id
	 */
	public com.jspgou.cms.entity.Order getOrder () {
		return order;
	}

	/**
	 * Set the value related to the column: total_id
	 * @param order the total_id value
	 */
	public void setOrder (com.jspgou.cms.entity.Order order) {
		this.order = order;
	}



	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.jspgou.cms.entity.ConsumerTop)) return false;
		else {
			com.jspgou.cms.entity.ConsumerTop consumerTop = (com.jspgou.cms.entity.ConsumerTop) obj;
			if (null == this.getId() || null == consumerTop.getId()) return false;
			else return (this.getId().equals(consumerTop.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}